Optimal. Leaf size=148 \[ \frac {\left (2 a^2+5 b^2\right ) \cot (c+d x)}{15 d}+\frac {\left (a^2-2 b^2\right ) \cot (c+d x) \csc ^2(c+d x)}{15 d}+\frac {a b \tanh ^{-1}(\cos (c+d x))}{4 d}-\frac {a b \cot (c+d x) \csc ^3(c+d x)}{10 d}+\frac {a b \cot (c+d x) \csc (c+d x)}{4 d}-\frac {\cot (c+d x) \csc ^4(c+d x) (a+b \sin (c+d x))^2}{5 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.39, antiderivative size = 148, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 9, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.310, Rules used = {2889, 3048, 3031, 3021, 2748, 3768, 3770, 3767, 8} \[ \frac {\left (2 a^2+5 b^2\right ) \cot (c+d x)}{15 d}+\frac {\left (a^2-2 b^2\right ) \cot (c+d x) \csc ^2(c+d x)}{15 d}+\frac {a b \tanh ^{-1}(\cos (c+d x))}{4 d}-\frac {a b \cot (c+d x) \csc ^3(c+d x)}{10 d}+\frac {a b \cot (c+d x) \csc (c+d x)}{4 d}-\frac {\cot (c+d x) \csc ^4(c+d x) (a+b \sin (c+d x))^2}{5 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2748
Rule 2889
Rule 3021
Rule 3031
Rule 3048
Rule 3767
Rule 3768
Rule 3770
Rubi steps
\begin {align*} \int \cot ^2(c+d x) \csc ^4(c+d x) (a+b \sin (c+d x))^2 \, dx &=\int \csc ^6(c+d x) (a+b \sin (c+d x))^2 \left (1-\sin ^2(c+d x)\right ) \, dx\\ &=-\frac {\cot (c+d x) \csc ^4(c+d x) (a+b \sin (c+d x))^2}{5 d}+\frac {1}{5} \int \csc ^5(c+d x) (a+b \sin (c+d x)) \left (2 b-a \sin (c+d x)-3 b \sin ^2(c+d x)\right ) \, dx\\ &=-\frac {a b \cot (c+d x) \csc ^3(c+d x)}{10 d}-\frac {\cot (c+d x) \csc ^4(c+d x) (a+b \sin (c+d x))^2}{5 d}-\frac {1}{20} \int \csc ^4(c+d x) \left (4 \left (a^2-2 b^2\right )+10 a b \sin (c+d x)+12 b^2 \sin ^2(c+d x)\right ) \, dx\\ &=\frac {\left (a^2-2 b^2\right ) \cot (c+d x) \csc ^2(c+d x)}{15 d}-\frac {a b \cot (c+d x) \csc ^3(c+d x)}{10 d}-\frac {\cot (c+d x) \csc ^4(c+d x) (a+b \sin (c+d x))^2}{5 d}-\frac {1}{60} \int \csc ^3(c+d x) \left (30 a b+4 \left (2 a^2+5 b^2\right ) \sin (c+d x)\right ) \, dx\\ &=\frac {\left (a^2-2 b^2\right ) \cot (c+d x) \csc ^2(c+d x)}{15 d}-\frac {a b \cot (c+d x) \csc ^3(c+d x)}{10 d}-\frac {\cot (c+d x) \csc ^4(c+d x) (a+b \sin (c+d x))^2}{5 d}-\frac {1}{2} (a b) \int \csc ^3(c+d x) \, dx-\frac {1}{15} \left (2 a^2+5 b^2\right ) \int \csc ^2(c+d x) \, dx\\ &=\frac {a b \cot (c+d x) \csc (c+d x)}{4 d}+\frac {\left (a^2-2 b^2\right ) \cot (c+d x) \csc ^2(c+d x)}{15 d}-\frac {a b \cot (c+d x) \csc ^3(c+d x)}{10 d}-\frac {\cot (c+d x) \csc ^4(c+d x) (a+b \sin (c+d x))^2}{5 d}-\frac {1}{4} (a b) \int \csc (c+d x) \, dx+\frac {\left (2 a^2+5 b^2\right ) \operatorname {Subst}(\int 1 \, dx,x,\cot (c+d x))}{15 d}\\ &=\frac {a b \tanh ^{-1}(\cos (c+d x))}{4 d}+\frac {\left (2 a^2+5 b^2\right ) \cot (c+d x)}{15 d}+\frac {a b \cot (c+d x) \csc (c+d x)}{4 d}+\frac {\left (a^2-2 b^2\right ) \cot (c+d x) \csc ^2(c+d x)}{15 d}-\frac {a b \cot (c+d x) \csc ^3(c+d x)}{10 d}-\frac {\cot (c+d x) \csc ^4(c+d x) (a+b \sin (c+d x))^2}{5 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.82, size = 236, normalized size = 1.59 \[ \frac {\csc ^5(c+d x) \left (-40 \left (4 a^2+b^2\right ) \cos (c+d x)+20 \left (b^2-2 a^2\right ) \cos (3 (c+d x))+8 a^2 \cos (5 (c+d x))-180 a b \sin (2 (c+d x))-30 a b \sin (4 (c+d x))-150 a b \sin (c+d x) \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )+75 a b \sin (3 (c+d x)) \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )-15 a b \sin (5 (c+d x)) \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )+150 a b \sin (c+d x) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )-75 a b \sin (3 (c+d x)) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )+15 a b \sin (5 (c+d x)) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )+20 b^2 \cos (5 (c+d x))\right )}{960 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.69, size = 195, normalized size = 1.32 \[ \frac {8 \, {\left (2 \, a^{2} + 5 \, b^{2}\right )} \cos \left (d x + c\right )^{5} - 40 \, {\left (a^{2} + b^{2}\right )} \cos \left (d x + c\right )^{3} + 15 \, {\left (a b \cos \left (d x + c\right )^{4} - 2 \, a b \cos \left (d x + c\right )^{2} + a b\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) - 15 \, {\left (a b \cos \left (d x + c\right )^{4} - 2 \, a b \cos \left (d x + c\right )^{2} + a b\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) - 30 \, {\left (a b \cos \left (d x + c\right )^{3} + a b \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{120 \, {\left (d \cos \left (d x + c\right )^{4} - 2 \, d \cos \left (d x + c\right )^{2} + d\right )} \sin \left (d x + c\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.22, size = 222, normalized size = 1.50 \[ \frac {3 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 15 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 5 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 20 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 120 \, a b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) - 30 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 60 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + \frac {274 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 30 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 60 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 5 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 20 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 15 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 3 \, a^{2}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5}}}{480 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.49, size = 156, normalized size = 1.05 \[ -\frac {a^{2} \left (\cos ^{3}\left (d x +c \right )\right )}{5 d \sin \left (d x +c \right )^{5}}-\frac {2 a^{2} \left (\cos ^{3}\left (d x +c \right )\right )}{15 d \sin \left (d x +c \right )^{3}}-\frac {a b \left (\cos ^{3}\left (d x +c \right )\right )}{2 d \sin \left (d x +c \right )^{4}}-\frac {a b \left (\cos ^{3}\left (d x +c \right )\right )}{4 d \sin \left (d x +c \right )^{2}}-\frac {a b \cos \left (d x +c \right )}{4 d}-\frac {a b \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{4 d}-\frac {b^{2} \left (\cos ^{3}\left (d x +c \right )\right )}{3 d \sin \left (d x +c \right )^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.38, size = 108, normalized size = 0.73 \[ -\frac {15 \, a b {\left (\frac {2 \, {\left (\cos \left (d x + c\right )^{3} + \cos \left (d x + c\right )\right )}}{\cos \left (d x + c\right )^{4} - 2 \, \cos \left (d x + c\right )^{2} + 1} - \log \left (\cos \left (d x + c\right ) + 1\right ) + \log \left (\cos \left (d x + c\right ) - 1\right )\right )} + \frac {40 \, b^{2}}{\tan \left (d x + c\right )^{3}} + \frac {8 \, {\left (5 \, \tan \left (d x + c\right )^{2} + 3\right )} a^{2}}{\tan \left (d x + c\right )^{5}}}{120 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 9.36, size = 187, normalized size = 1.26 \[ \frac {a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5}{160\,d}-\frac {{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (\frac {a^2}{3}+\frac {4\,b^2}{3}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (2\,a^2+4\,b^2\right )+\frac {a^2}{5}+a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{32\,d}-\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {a^2}{16}+\frac {b^2}{8}\right )}{d}+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (\frac {a^2}{96}+\frac {b^2}{24}\right )}{d}+\frac {a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{32\,d}-\frac {a\,b\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{4\,d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________